home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 61 / Quick PC 61.iso / I386 / ADMT / CPYSYM.CMD < prev    next >
Encoding:
Text File  |  2003-04-22  |  2.4 KB  |  105 lines

  1. @ECHO OFF
  2.  
  3. REM -----------------------------------------------------------------------------
  4. REM This batch file is used to copy all ADMT-related symbol files to a directory.
  5. REM -----------------------------------------------------------------------------
  6.  
  7. SET CommandName=%0%
  8.  
  9. REM Help
  10. IF "%1%"=="/?" GOTO ERROR_HELP
  11.  
  12. REM
  13. REM Exactly two arguments
  14. REM
  15.  
  16. IF "%1%"=="" (
  17.     ECHO Must have the SourcePath argument.
  18.     GOTO ERROR_ARGS
  19. )
  20.  
  21. SET SourcePath=%1%
  22. SHIFT
  23.  
  24. IF "%1%"=="" (
  25.     ECHO Must have the TargetPath argument.
  26.     GOTO ERROR_ARGS
  27. )
  28.  
  29. SET TargetPath=%1%
  30. SHIFT
  31.  
  32. IF NOT "%1%"=="" (
  33.     ECHO There are more than two command line arguments.
  34.     GOTO ERROR_ARGS
  35. )
  36.  
  37. REM
  38. REM Create and check source and target directories
  39. REM
  40.  
  41. IF NOT EXIST %SourcePath% (
  42.     ECHO %SourcePath% does not exist.
  43.     GOTO EXIT
  44. )
  45.  
  46. IF NOT EXIST %TargetPath% (
  47.     MD %TargetPath%
  48.     IF ERRORLEVEL 1 (
  49.        ECHO %TargetPath% is not accessible.
  50.        GOTO EXIT
  51.     )
  52. )
  53.  
  54. REM
  55. REM Copy files
  56. REM
  57.  
  58. FOR %%i in (ADMT ADMTAgnt ADMTAgntNT4 DCTAgentService DCTAgentServiceNT4 McsDispatcher) DO (
  59.     ECHO Copying %%i.pdb ...
  60.     COPY %SourcePath%\exe\%%i.pdb %TargetPath%\%%i.pdb > NULL
  61.     if errorlevel 1 (
  62.         ECHO Unable to copy symbol file %%i.pdb from %SourcePath%\exe to %TargetPath%
  63.         GOTO EXIT
  64.     )
  65. )
  66.  
  67. FOR %%i in (AddToGroup ADMTScript DBManager DisableTargetAccount DomMigSI GetRids McsADsClassProp McsDctWorkerObjects McsDctWorkerObjectsNT4 McsMigrationDriver MCSNetObjectEnum McsPISag McsPISagNT4 McsVarSetMin McsVarSetMinNT4 MoveObj MsPwdMig ScmMigr SetTargetPassword TrustMgr UpdateDB UpdateMOT UPNUpdt wizards) DO (
  68.     ECHO Copying %%i.pdb ...
  69.     COPY %SourcePath%\dll\%%i.pdb %TargetPath%\%%i.pdb > NULL
  70.     if errorlevel 1 (
  71.         ECHO Unable to copy symbol file %%i.pdb from %SourcePath%\dll to %TargetPath%
  72.         GOTO EXIT
  73.     )
  74. )
  75.  
  76. ECHO All symbol files copied.
  77. GOTO EXIT
  78.  
  79. REM
  80. REM Arguments are invalid.
  81. REM
  82.  
  83. :ERROR_ARGS
  84.  
  85. ECHO Invalid arguments!
  86.  
  87. GOTO ERROR_HELP
  88.  
  89.  
  90. REM
  91. REM Print out the help message.
  92. REM
  93.  
  94. :ERROR_HELP
  95.  
  96. ECHO Usage: %CommandName% SourcePath TargetPath
  97. ECHO     SourcePath:  source symbol file directory
  98. ECHO     TargetPath:  target symbol file directory
  99. ECHO   %CommandName% copies ADMT-related symbol files from dll and exe
  100. ECHO     subdirectories of SourcePath to TargetPath.
  101.  
  102. GOTO EXIT
  103.  
  104. :EXIT
  105. REM End of the batch file